# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-rfc3339-validator
#_pkgreal is used by apkbuild-pypi to find modules at PyPI
_pkgreal=rfc3339-validator
pkgver=0.1.4
pkgrel=0
pkgdesc="A pure python RFC3339 validator"
url="https://github.com/naimetti/rfc3339-validator"
arch="noarch"
license="MIT"
depends="
	py3-six
"
checkdepends="
	py3-pytest
	py3-strict-rfc3339
	py3-hypothesis
"
makedepends="
	py3-setuptools
	py3-gpep517
	py3-wheel
"
options="!check" # missing py3-strict-rfc3339
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/naimetti/rfc3339-validator/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer "$builddir"/.dist/*.whl
	.testenv/bin/python3 -m pytest -v
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
ed593b31c4984cdbc313e42dc0432173eaa649712e29627ab462dfa262efb30cee97b74f589d3d211c2193623fac3baca560a52a7a3f718071a63482e06c4203  py3-rfc3339-validator-0.1.4.tar.gz
"
